package com.mind.adjust.controller;

import com.mind.adjust.domain.vo.dashboard.DashboardVo;
import com.mind.adjust.service.impl.DashboardService;
import com.mind.common.core.domain.AjaxResult;
import com.mind.system.domain.AjMonthReport;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;


/**
 * 智能审核模块/审核模块/数字大屏
 *
 * @author makejava
 * @DocView.PathPrefix {{host}}/api/adjust
 * @since 2024-07-28 22:00:58
 */
@RestController
@RequestMapping("adjust/dashboard")
public class DashboardController {
    @Resource
    private DashboardService dashboardService;

    /**
     * 获取单量
     * @param dashboardVo
     * @return
     */
    @PostMapping("/getTicketCount")
    public AjaxResult getTicketCount(@RequestBody DashboardVo dashboardVo){
        return AjaxResult.success(dashboardService.getTicketCount(dashboardVo));
    }

    /**
     * 获取一次通过率
     * @param dashboardVo
     * @return
     */
    @PostMapping("/getTicketPassRate")
    public AjaxResult getTicketPassRate(@RequestBody DashboardVo dashboardVo){
        return AjaxResult.success(dashboardService.getTicketPassRate(dashboardVo));
    }

    /**
     * 获取规则通过率
     * @param dashboardVo
     * @return
     */
    @PostMapping("/getRulePassRate")
    public AjaxResult getRulePassRate(@RequestBody DashboardVo dashboardVo){
        return AjaxResult.success(dashboardService.getRulePassRate(dashboardVo));
    }

    /**
     * 单据概况
     * @param dashboardVo
     * @return
     */
    @PostMapping("/getTicketOverview")
    public AjaxResult getTicketOverview(@RequestBody DashboardVo dashboardVo){
        return AjaxResult.success(dashboardService.getTicketOverview(dashboardVo));
    }

    /**
     * 规则概况
     * @param dashboardVo
     * @return
     */
    @PostMapping("/getRuleOverview")
    public AjaxResult getRuleOverview(DashboardVo dashboardVo){
        return AjaxResult.success(dashboardService.getRuleOverview(dashboardVo));
    }

    /**
     * 规则千次占比
     * @param report
     * @return
     */
    @GetMapping("/getRulePassRateBate")
    public AjaxResult getRulePassRateBate( AjMonthReport report){
        return AjaxResult.success(dashboardService.getRulePassRateBate(report));
    }
}
